package Si.Assign1.Model;

import java.io.Serializable;
import java.sql.Clob;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import com.sun.jmx.snmp.Timestamp;

@Entity
@Table(name="Categories")
@NamedQueries(
     {
    @NamedQuery(name="listCategories",
                query="SELECT c FROM Categories c"),
    @NamedQuery(name="getCategoriesById",
                query="SELECT c FROM Categories c WHERE c.id = :id"),
    @NamedQuery(name="getCategoriesByName",
                query="SELECT c FROM Categories c WHERE c.name = :name")
     }
		)

public class Categories 
{
	public Categories(){}
	
	/*
	 * Properties
	 */
	
	/*
	 * Set and get id
	 */
	public int getId()
	{	return id;     }
	public void setId(int id)
	{   this.id = id;  }

	/*
	 * Set and get parent_id
	 */
	public int getParentId()
	{   return parentId;   }
	public void parentId(int parentId)
	{   this.parentId = parentId;  }
	
	/*
	 * Set and get name
	 */
	public String getName()
	{   return name;   }
	public void setName(String name)
	{   this.name = name;  }
	
	/*
	 * Set and get Product_type
	 */
	public int getProductType()
	{	return productType;	}	
	public void setProductType(int productType)
	{   this.productType = productType;  }
	
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Basic(optional=false)
	@Column(name="id", nullable=false)
	private int id;
	@Column(name="parent_id", nullable=false)
	private int parentId;
	@Column(name="name", length = 255, nullable=false)
	private String name;
	@Column(name="product_type", nullable=false)
	private int productType;

}
